import { axios } from '@/utils/request'

const api = {
    typeAll: '/notify/type/all', //固定资产名称查询
    notifyCreate: '/notify/info/create',
    getNotRead: '/notify/info/getNotRead', // 未读
    getRead: '/notify/info/getRead',
    updateRead: '/notify/info/updateRead',
    updateDelete: '/notify/info/updateDelete',
    getPublicRead: '/notify/info/getPublicRead',
    getPublicReadAll: '/notify/info/getPublicReadAll',
    publicRead: '/notify/public/read/create'
}

// publicRead
export function publicRead(data) {
    return axios({
        url: api.publicRead,
        method: 'post',
        data
    })
}

export function getPublicReadAll(params) {
    return axios({
        url: api.getPublicReadAll,
        method: 'get',
        params
    })
}

// getPublicRead
export function getPublicRead(params) {
    return axios({
        url: api.getPublicRead,
        method: 'get',
        params
    })
}

export function getNotRead(params) {
    return axios({
        url: api.getNotRead,
        method: 'get',
        params
    })
}

export function getRead(params) {
    return axios({
        url: api.getRead,
        method: 'get',
        params
    })
}

// ruleChangeState
export function typeAll(params) {
    return axios({
        url: api.typeAll,
        method: 'get',
        params
    })
}

// 新增 notifyCreate
export function notifyCreate(data) {
    return axios({
        url: api.notifyCreate,
        method: 'post',
        data
    })
}

// updateRead
export function updateRead(data) {
    return axios({
        url: api.updateRead,
        method: 'put',
        data
    })
}

// updateDelete
export function updateDelete(data) {
    return axios({
        url: api.updateDelete,
        method: 'put',
        data
    })
}

export function noticeCount() {
    return axios({
        url: '/notify/info/noticeCount',
        method: 'get'
    })
}